#include "includes.h"
#include "txd_stdapi.h" 
#include "txd_baseapi.h"
#include "sockets.h"
#include "lwip/memp.h"
#include "lwIP.h"
#include "lwIP/tcp.h"
#include "lwIP/udp.h"
#include "lwIP/tcpip.h"
#include "netif/etharp.h"
#include "lwIP/dhcp.h"
#include "arch/sys_arch.h"
#include "lwIP/sockets.h"
#include "lwIP/netdb.h"
#include "lwIP/dns.h"
#include "lwIP/arch.h"
#include "errno.h"

void txd_memcpy (void *dest, const void *src, uint32_t n){
    memcpy(dest, src, n);
}

void txd_memset (void *p, int c, uint32_t n){
    memset(p, c, n);
}

int32_t txd_memcmp (const void *p1, const void *p2, uint32_t n){
    return memcmp(p1, p2, n);
}

uint32_t txd_strlen (const char *s){
    return strlen(s);
}

int32_t txd_atoi (const char *s){
    return atoi(s);
}

int32_t txd_vsnprintf (char *s, uint32_t size, const char *template, va_list ap){
    return vsnprintf(s, size, template, ap);
}

int32_t txd_printf (const char *template, ...){
    static char bufPrint[512]={0};
	va_list args;
    int32_t i = 0;
    memset(bufPrint, 0, sizeof(bufPrint));
    va_start(args, template);
    i = vsnprintf(bufPrint, sizeof(bufPrint), template, args);
    va_end(args);
    printf("%s", bufPrint);
    return i;
}